package com.dcits.servicemanagement.controller;

import com.dcits.servicemanagement.common.entity.JsonResult;
import com.dcits.servicemanagement.common.utils.ResultTool;
import com.dcits.servicemanagement.entity.SysUser;
import com.dcits.servicemanagement.exception.NotLoginException;
import com.dcits.servicemanagement.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Classname UserController
 * @Description TODO
 * @Version 1.0.0
 * @Date 2022/4/22 18:11
 * @Created by hejle
 */
@Controller
@Slf4j
public class UserController {

    @Autowired
    SysUserService sysUserService;
    @Autowired
    UserDetailsService userDetailsService;

    @GetMapping("/getUser")
    public JsonResult getUser() {
        List<SysUser> users = sysUserService.queryAllByLimit(1, 100);
        return ResultTool.success(users);
    }

    @GetMapping("/test")
    public JsonResult test() {
        return ResultTool.success("hello world");
    }



}